package com.botann.projects.model;


import com.botann.projects.annotations.Pass;
import com.botann.projects.annotations.Pass;

import javax.persistence.*;

@Entity
@Table(name = "view_item", schema = "faith_rent", catalog = "")
public class ViewItem {
    private int id;
    private int viewId;
    private String name;
    private String prop;

    @Pass
    private boolean showing;
    @Pass
    private boolean clickable;

    public boolean isShowing() {
        return showing;
    }

    public void setShowing(boolean showing) {
        this.showing = showing;
    }

    public boolean isClickable() {
        return clickable;
    }

    public void setClickable(boolean clickable) {
        this.clickable = clickable;
    }

    @Id
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "view_id", nullable = false)
    public int getViewId() {
        return viewId;
    }

    public void setViewId(int viewId) {
        this.viewId = viewId;
    }

    @Basic
    @Column(name = "name", nullable = false, length = 255)
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "prop", nullable = false, length = 30)
    public String getProp() {
        return prop;
    }

    public void setProp(String prop) {
        this.prop = prop;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ViewItem viewItem = (ViewItem) o;

        if (id != viewItem.id) return false;
        if (viewId != viewItem.viewId) return false;
        if (name != null ? !name.equals(viewItem.name) : viewItem.name != null) return false;
        if (prop != null ? !prop.equals(viewItem.prop) : viewItem.prop != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + viewId;
        result = 31 * result + (name != null ? name.hashCode() : 0);
        result = 31 * result + (prop != null ? prop.hashCode() : 0);
        return result;
    }
}
